<?php
/*
echo "<pre>";
print_r($comments);
echo "</pre>";
exit;
*/


if(isset($comments)){
foreach($comments as $comment):
?>
<div class="newpost" id="<?=$comment->comment_id?>">
<div class="postbox"><?=$comment->comment?></div>
<div class="postinfoBox">
<div class="postinfo">
<p>Posted by:<?=$comment->name?></p>
<p>Date Posted:<?=$comment->date?></p>
<p>Time Posted: 05:05 PM</p>
 </div>
<?php if($comment->user_id==$this->session->userdata(0)->user_id){ ?>
    <img title="remove this post" id="removepost_<?=$comment->comment_id?>" class="removebtn" src="<?=base_url()?>media/images/removepost1.jpg"/>
<?php } ?>
</div>
</div>
<?php
endforeach;
}
?>